package com.flynn.rock.system.repository;

import com.flynn.rock.system.entity.SysUserRoleRelationEntity;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysUserRoleRelationRepository extends CrudRepository<SysUserRoleRelationEntity, Long> {

    SysUserRoleRelationEntity findByUserIdAndRoleId(Long userId, Long roleId);

    List<SysUserRoleRelationEntity> findAllByUserId(Long userId);

    void deleteAllByUserId(Long userId);
}
